//
//  HHText.swift
//  HHSwiftuiPractice
//
//  Created by YL-Hong on 2023/9/25.
//

import SwiftUI

struct HHText: View {
    var body: some View {
        
        Text("Hello, World!")// 显示的文本内容
            .font(.title) // 字体
            .fontWeight(.bold) // 字重
            .underline(true, pattern: .solid, color: Color.green)//自定义下划线
            .italic() //斜体
            .strikethrough(true, pattern: .solid, color: Color.red)//自定义删除线
        
        Text("Hi, welcome! This is Text() Components in SwiftUI, try to copy this code, and paste it into you Swiftui file, and you can see the effect".capitalized)//首字母大写设置
            .font(.system(size: 24))//自定义字体
            .baselineOffset(20)//设置多行字体行间距
            .kerning(5) //设置字母与字母之间的距离
            .multilineTextAlignment(.center)// 多行文本的对其方式
            
    }
}

struct HHText_Previews: PreviewProvider {
    static var previews: some View {
        HHText()
    }
}
